import constants from '@/constants';

export default () => ({
  port: parseInt(process.env.PORT, 10) || 9000,
  host: '0.0.0.0',
  prefix: 'api',
  defaultCaptcha: process.env.DEFAULT_CAPTCHA,
  homeUrl: process.env.HOME_URL,
  name: process.env.APP_NAME,
  blockchain: process.env.APP_BLOCK_CHAIN,
  payment: process.env.APP_PAYMENT,
  isUseBalance: process.env.APP_USE_BALANCE === 'true',
  multipart: {
    throwFileSizeLimit: true,
    limits: {
      files: 1,
      fileSize: 1024 * 1024 * 50,
    },
  },
  validation: {
    transform: true,
    skipMissingProperties: true,
    skipNullProperties: true,
    skipUndefinedProperties: true,
    stopAtFirstError: true,
    enableDebugMessages: constants.isDev,
  },
});
